package com.utils;

public class OSUtils {
    private static String OS = System.getProperty("os.name").toLowerCase();

    public static boolean isWindows() {
        System.out.println("操作系统名字==="+OS);
        return OS.contains("win");
    }

    public static boolean isLinux() {
        return OS.contains("nix") || OS.contains("nux") || OS.contains("aix");
    }

    public static void main(String[] args) {
        if (isWindows()) {
            System.out.println("The current operating system is Windows.");
        } else if (isLinux()) {
            System.out.println("The current operating system is Linux.");
        } else {
            System.out.println("The current operating system is neither Windows nor Linux.");
        }
    }
}
